﻿using AutoMapper;

namespace JIESHINet.Extensions
{
    /// <summary>
    /// 静态全局 AutoMapper配置文件
    /// </summary>
    public class AutoMapperConfig
    {
        /// <summary>
        /// 创建一个静态的MapperConfiguration作为配置对象映射规则
        /// </summary>
        /// <returns></returns>
        public static MapperConfiguration RegisterMappings()
        {
            //MapperConfiguration 是 AutoMapper 库中的一个类，用于配置对象映射规则
            return new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new CustomProfile());
            });
        }
    }
}
